<?php
require_once 'application/library/db/gcDaoFactory.php';
require_once 'application/constant/daoConfig.php';
/**
 * user_services_changePswService
 * @author    Soochow University
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */

class user_services_changePswService {

    private $objDaoFactory;

    public function __construct(){
        $this->objDaoFactory = gcDaoFactory::getInstance();
    }

    public function pbCheckOrgPsw($strUserId, $strOrgPsw){
        $objDao = $this->objDaoFactory->createDao(daoConfig::T_BA_M_USER_DAO);
        $intResult = $objDao->pbGetOrgPswByUserId($strUserId, $strOrgPsw);
        if ($intResult > 0) {
            return true;
        } else {
            return false;
        }
    }
    
    public function pbUpdatePsw($strUserId, $strOrgPsw, $strNewPsw) {
        $objDao = $this->objDaoFactory->createDao(daoConfig::T_BA_M_USER_DAO);
        $intCount = $objDao->pbUpdatePsw($strUserId, $strOrgPsw, $strNewPsw);
        return $intCount;
    }

}